
import request from "./request"

type objTypes= {
    role?:string,
    phone?:string,
    time?:string,
    username?:string
}
export const getUserApi = (obj?:objTypes)=>{
    return request.post<any,axiosType<foundUserType[]>>('/pro/user/list',obj)
}


// 修改用户数据
export const uploadUserApi = (password:string,_id:string,username:string,role:number,phone:string)=>{
    return request.post<any,axiosType<setpasstypes>>("/pro/user/update",{
        password,
        username,
        _id,
        phone,
        role
    })
}

// 新增用户
export const addUserApi = (phone:string,password:string,username:string,role:number)=>{
    return request.post<any,axiosType<foundUserType[]>>('/pro/user/create',{
        password,
        phone,
        username,
        role
    })
}

// 删除用户
export const deleUserApi = (_id:string)=>{
    return request.post("/pro/user/delete",{_id})
}